CC = gcc
AR = ar cru
SRC = ../nantx/main/main.cc ../nantx/ant/NetUtils.cc ../nantx/ant/Threads.cc ../nantx/ant/Facade.cc ../nantx/ant/Network.cc ../nantx/ant/HttpHandler.cc ../nantx/ant/SockHandler.cc ../nantx/ant/aclHandler.cc ../nantx/ant/NantSock.cc helper/Helper.cc

CFLAGS = -Wall -D_REENTRANT -D_GNU_SOURCE -fPIC  -g3 
SOFLAGS = -shared
LDFLAGS =   # -lresolv

LINKER = $(CC)
LINT = lint -c
RM = /bin/rm -f

LIBS = -L/home/y/lib -L/usr/local/lib -L/usr/lib  \
	    -pthread -lstdc++  -levent

INCLUDES =  -I/home/y/include -I/usr/local/include -I../nantx/ant  -I./helper -I/usr/include  -I/usr/include 

OPTFLAG =  -D_THREAD_SAFE  -D_DEBUG -fno-default-inline 

CFLAGS  += $(INCLUDES) 
CFLAGS  += $(OPTFLAG) 
LDFLAGS += $(LIBS) 
#--------------------------------------------------------------------
OBJS = $(SRC:.cc=.o)
TARGET = bin/testD
#--------------------------------------------------------------------
all:$(TARGET)
bin/testD:$(OBJS)
	$(LINKER) $(LDFLAGS) $(OPTFLAG) $(OBJS)  -o $@

clean:
	@( $(RM) *.o vgcore.*  $(TARGET) )
	rm ../nantx/ant/*.o ../nantx/main/*.o helper/*.o 
#--------------------------------------------------------------------
# make rule
%.o : %.cc
	$(CC) $(CFLAGS) -c $^ -o $@	

%.o : %.cpp
	$(CC) $(CFLAGS) -c $^ -o $@	

